<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>弓友之家</title>
    <link rel="stylesheet" href="css/mui.css" />
    <link rel="stylesheet" href="fonts/iconfont.css" />
    <link rel="stylesheet" href="css/style.css" />
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title">用户投诉</h1>
	</header>
	<div class="mui-content">
		<form class="address">
			<div class="form-item mui-clearfix">
				<label><span>*</span>购买商品：</label>
				<input type="text" id="goodsName" placeholder="点击输入商品名称" />
			</div>
			<div class="form-item mui-clearfix">
				<label><span>*</span>订单编号：</label>
				<input type="text" id="orderNumber" placeholder="点击输入订单编号" />
			</div>
			<div class="form-item mui-clearfix">
				<label>店铺名称：</label>
				<input type="text" id="shopName" placeholder="点击输入店铺名称" />
			</div>
			<div class="form-item mui-clearfix">
				<label><span>*</span>投诉问题：</label>
				<textarea id="content"></textarea>
			</div>
			<button type="button" onclick="sub()">确认提交</button>
		</form>
	</div>
	<script type="text/javascript" src="js/mui.min.js" ></script>
	<script type="text/javascript" src="js/jquery-1.8.3.min.js" ></script>
	<script type="text/javascript" src="js/common.js" ></script>
	<script type="text/javascript" src="js/distpicker.data.js" ></script>
	<script type="text/javascript" src="js/distpicker.js" ></script>
	<script type="text/javascript" charset="utf-8">
      	mui.init();
      	function sub(){
      		var goodsName=$("#goodsName").val();
      		var orderNumber=$("#orderNumber").val();
      		var shopName=$("#shopName").val();
      		var content=$("#content").val();
      		if(goodsName==""){
      			mui.toast("商品名称不能为空");
      			return false;
      		}
      		if(orderNumber==""){
      			mui.toast("订单号不能为空");
      			return false;
      		}
      		if(content==""){
      			mui.toast("内容不能为空");
      			return false;
      		}
      		mui.ajax(H_SRC+'/amier/user/complaint',{
				data:{
					token:token,
					goodsName:goodsName,
					orderNumber:orderNumber,
					shopName:shopName,
					content:content,
				},
				dataType:'json',
				type:'post',
				timeout:10000,             
				success:function(data){
					var dataurl=data.data;
					if(data.code == 1){
	      				mui.toast("提交成功，感谢您的建议，我们将更加完善");
	      				window.location.reload();
					}else{
						mui.toast(data.msg);
					}
				},
				error:function(){
					
				}
			}) 
      	}
    </script>
</body>
</html>